package collection;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class SstramAPIDemo4 {
    public static void main(String[] args) {
        Integer[] array={1,2,3,4,5,5,6,7,8};

    //利用数组工具类Arrays可以将一个数组转化为一个Stream
        List<Integer> list = Arrays.stream(array)
                .filter(e->e%2==0)
                .map(e->e*3)
                .collect(Collectors.toList());
        System.out.println(list);
    }
}
